package com.cuit.retryies;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

public class RetryMap {

    private final Map<String, AtomicInteger> retriesMap = new ConcurrentHashMap<>();

    public AtomicInteger get(String channel){
        AtomicInteger orDefault = retriesMap.getOrDefault(channel, new AtomicInteger(0));
        retriesMap.put(channel, orDefault);
        return orDefault;
    }

}
